<?php
//   session_start();
  // 1.连接数据库
  include "conn.php";
  
  if(isset($_POST['tel'])){
    $tel = $_POST['tel'];//获取手机号
    $result = $conn->query("select * from registry_login where tel='$tel'");
    if ($result->fetch_assoc()){//手机号存在
      $pass = sha1($_POST['pass']);
      $result1 = $conn->query("select * from registry_login where tel='$tel' and password='$pass'")
      
      if($result1->fetch_assoc()){//手机号和密码都正确
        $arr_info_success = Array('status'=>3,'msg'=>'密码正确');
        echo json_encode($arr_info_success); 
      }else{
        $arr_info_fail = Array('status'=>2,'msg'=>'密码错误');
        echo json_encode($arr_info_fail);
      }
    }else{//手机号不存在
      $arr_info = Array('status'=>1,'msg'=>'手机号不存在');
      echo json_encode($arr_info);
    }
  }


  ?>